﻿using IcicleFramework.Collision;
using BoundingBox = IcicleFramework.Collision.BoundingBox;

namespace IcicleFramework.Components.Collision
{
    public delegate void CollisionHandler(ICollisionComponent source, ICollisionComponent collided, CorrectionVector2 resolutionVector);

    public interface ICollisionComponent : IBaseComponent
    {
        event CollisionHandler Collision;

        /// <summary>
        /// Gets or sets the Collision Priority of this ICollidable object.
        /// </summary>
        int CollisionPriority { get; }

        /// <summary>
        /// Gets or sets whether or not this ICollidable object collides with objects of the same priority or not.
        /// </summary>
        bool CollidesWithSamePriority { get; set; }

        /// <summary>
        /// Gets or sets whether or not this ICollidableComponent is solid.
        /// </summary>
        bool Solid { get; set; }

        /// <summary>
        /// Gets the bounding box associated with this ICollidable object.
        /// </summary>
        BoundingBox BoundingBox
        {
            get; 
            set;
        }

        CorrectionVector2 GetCorrectionVector(ICollisionComponent B);
    }
}
